---
- name: set hostname
  hostname: name={{ hostname }}
  when: hostname is defined

- name: install basic packages
  action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
  with_items:
  - vim
  - tmux
  - wget
  - git
  - net-tools
  - tree

- name: install yum-utils when using yum
  package: name=yum-utils state=present
  when: ansible_pkg_mgr == "yum"

- name: enable rhel7 repos
  command: yum-config-manager --enable {{ item }}
  with_items:
  - rhel-7-server-optional-rpms
  - rhel-7-server-extras-rpms
  when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'

- name: enable epel7
  package: name={{ epel7_url }} state=present
  when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7'

- name: install firewalld
  action: "{{ ansible_pkg_mgr }} name=firewalld state=present"
  when: osbs_manage_firewalld

- name: enable firewalld
  service: name=firewalld state=started enabled=yes
  when: osbs_manage_firewalld
